Can't find what you're looking for?
Hit the online chat button bottom left, or click the contact Kademi button below.
With custom apps you can store JSON Data in the JSON Database, you can also managing the settings of the database like Website access or title.
This can be done through the admin portal or can be set from a custom app.
To get started, navigate to the Data / JSON Data section of your admin site. Create a new JSON database with the large green button at top left. Choose a simple name (note the naming restrictions) and a title for your database.
Your new database appears as a row in the table. The blue button to the right of the row allows you to either manage or delete your database. Click the manage button.
You now see four tabs, Details, Notes, Records and Query.
This page allows you to set several options:
Any text can be added here, but it has no effect on the operation of the database.
You can add, import and delete records from your JSON database in this tab.
Click the Add record button and get a dialog to add a new record.
Every record must have a simple name that is a valid JSON string, and a document type. The body of the record must be valid JSON.
Select one or more records by checkbox and click the delete button.
Click the Import CSV button for a dialog to upload a CSV file.
There are few restrictions on the format and capabilities of the CSV import:
Arbitrary JSON queries can be executed in this tab for development and testing purposes.
Doing with a the custom app that will be using the database makes it simply to manage the database for the app, and maybe you want the app to control access to the database.
On the server side JavaScript you can access the database when a user calls a GET, POST or DELETE method by using the "page" parameter passed to the method. From this you can call page.find('/jsondb/{you database name}').
Once you have the JSON Database resource you can call the following functions to get or set settings:
For example to set the database to allow access you would do something similar to this:
var jsonDB = page.find('/jsondb/myDB'); transactionManager.begin(); jsonDB.setAllowAccess(allowAccess); transactionManager.commit();
To see if the database has read only right you would have the following code:
var jsonDB = page.find('/jsondb/myDB'); var readOnly = jsonDB.readOnly;
Or to get the title of the database and add some text and save it again:
var jsonDB = page.find('/jsondb/myDB'); var dbTitle = jsonDB.title; transactionManager.begin(); jsonDB.setTitle(dbTitle + "_2"); transactionManager.commit();
Hit the online chat button bottom left, or click the contact Kademi button below.